module.exports = function (url, method = "GET", data = null) {
  const baseURL = 'http://jsonplaceholder.typicode.com'
  wx.showLoading({
    title: '加载中...',
  })
  return new Promise((resolve, reject) => {
    wx.request({
      url: baseURL + url,
      method,
      data,
      success: resolve,
      fail: reject,
      complete() {
        wx.hideLoading()
      }
    })
  })
}